﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AmazonServices
{
    /// <summary>
    /// Amazon response groups
    /// </summary>
    public enum ResponseGroup
    {

        /// <summary>
        /// The Small response group returns basic information 
        /// about items in a response. The information includes 
        /// the item's ASIN, DetailPageURL, title, product 
        /// group, and author. 
        /// </summary>
        Small,
        /// <summary>
        /// The Medium response group returns a great deal of 
        /// information about the items in a response. The 
        /// response group is ideally suited for creating 
        /// lightweight, product detail pages. 
        /// </summary>
        Medium,
        /// <summary>
        /// The Large response group returns a great deal 
        /// of information about items in the response.
        /// </summary>
        Large,
        /// <summary>
        /// The ItemAttributes response group returns a 
        /// potentially large number of attributes that describe an item.
        /// </summary>
        ItemAttributes,
        /// <summary>
        /// The Images response group returns the URLs to all available images of an item in three sizes: small, medium, and large. 
        /// In addition to returning the URLs of the images, the response groups also returns the height and width dimensions of each image. Use these values to help you display the images correctly.
        /// </summary>
        Images
    }

    /// <summary>
    /// Converter class for ResponseGroup enum
    /// </summary>
    public static class ResponseGroupConverter
    {
        /// <summary>
        /// Converts a response group enum element to string representation
        /// </summary>
        /// <param name="instance">The instance.</param>
        /// <returns></returns>
        public static string ToStringName(this ResponseGroup instance)
        {
            return Enum.GetName(typeof(ResponseGroup), instance);
        }

        /// <summary>
        /// Converts a response group representation to enum element.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        public static ResponseGroup FromString(string value)
        {
            return (ResponseGroup)Enum.Parse(typeof(ResponseGroup), value);
        }
    }
}
